﻿
Partial Class WebForm_ManageTrainingCourse
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.InitData()
        End If
    End Sub

#Region "訓練課程"

    Protected Sub lknAddCourse_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lknAddCourse.Click
        '新增模式
        Me.TabContainer1.ActiveTab = Me.AddTrainingCourseTabPanel
        Me.AddTrainingCourse1.InitData(0)
    End Sub

    Protected Sub QueryTrainingCourse_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryTrainingCourse1.SelectedIndexChanged
        '編輯模式
        Me.TabContainer1.ActiveTab = Me.AddTrainingCourseTabPanel
        Me.AddTrainingCourse1.InitData(Me.QueryTrainingCourse1.SelectedID)
    End Sub

    Protected Sub AddTrainingCourse1_Saving(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddTrainingCourse1.Saving
        '編輯存檔後
        Me.TabContainer1.ActiveTab = Me.QueryTrainingCourseTabPanel
        Me.QueryTrainingCourse1.InitData()
        Me.AddTrainingCourse1.InitData(0)
    End Sub

    Protected Sub QueryTrainingCourse_GVDelete(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryTrainingCourse1.GVDelete
        '刪除
        Me.AddTrainingCourse1.InitData(0)
    End Sub

#End Region

#Region "場次"
    Protected Sub lknAddCourseGroup_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lknAddCourseGroup.Click
        '新增模式
        Me.TabContainer1.ActiveTab = Me.AddTrainingCourseGroupTabPanel
        Me.AddTrainingCourseGroup1.InitData(0)
    End Sub

    Protected Sub QueryTrainingCourseGroup_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryTrainingCourseGroup1.SelectedIndexChanged
        '檢視
        Me.TabContainer1.ActiveTab = Me.AddTrainingCourseGroupTabPanel
        Me.AddTrainingCourseGroup1.DataAccessMode = FormViewMode.ReadOnly
        Me.AddTrainingCourseGroup1.InitData(Me.QueryTrainingCourseGroup1.SelectedID)
    End Sub

    Protected Sub QueryTrainingCourseGroup_Editing(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryTrainingCourseGroup1.Editing
        '編輯
        Me.TabContainer1.ActiveTab = Me.AddTrainingCourseGroupTabPanel
        Me.AddTrainingCourseGroup1.DataAccessMode = FormViewMode.Edit
        Me.AddTrainingCourseGroup1.InitData(Me.QueryTrainingCourseGroup1.SelectedID)
    End Sub

    Protected Sub QueryTrainingCourseGroup_GVDelete(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryTrainingCourseGroup1.GVDelete
        '刪除
        Me.AddTrainingCourseGroup1.InitData(0)
    End Sub

    Protected Sub AddTrainingCourseGroup1_Saving(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddTrainingCourseGroup1.Saving
        '編輯存檔後
        Me.TabContainer1.ActiveTab = Me.QueryTrainingCourseGroupTabPanel
        Me.QueryTrainingCourseGroup1.InitData()
        Me.AddTrainingCourseGroup1.InitData(0)
    End Sub



#End Region

End Class

Partial Class WebForm_ManageTrainingCourse

    Private Sub InitData()
        Me.QueryTrainingCourse1.InitData()
        Me.AddTrainingCourse1.InitData(0)

        Me.QueryTrainingCourseGroup1.InitData()
        Me.AddTrainingCourseGroup1.InitData(0)

    End Sub

End Class